FROM mcr.microsoft.com/dotnet/core/aspnet:6.0-buster-slim AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/core/sdk:6.0-buster AS publish
WORKDIR /
COPY . .
WORKDIR "JESAI.HttpRequestMonitor.Web"
RUN dotnet restore "JESAI.HttpRequestMonitor.Web.csproj"
RUN dotnet publish "JESAI.HttpRequestMonitor.Web.csproj" -f net6.0 -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "JESAI.HttpRequestMonitor.Web.dll"]